package com.koudai.reader.conponment;

import android.app.Dialog;
import android.content.Context;
import android.text.Html;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import android.widget.Toast;

import com.koudai.reader.android.R;

public class MessageDialog extends Dialog {

    private TextView content;
    
    public MessageDialog(Context context, String text) {
        super(context);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.message_view);
        
        content = (TextView) findViewById(R.id.body);
        
        if (text != null) {
            content.setText(Html.fromHtml(text));    
        } else {
            Toast.makeText(context, "网络不给力", Toast.LENGTH_SHORT).show();
        }
        
    }

}
